<style>
    .edui-default .edui-editor-toolbarboxouter {
        background-image: none;
    }

    .edui-default .edui-editor-toolbarbox {
        box-shadow: none
    }
</style>
<textarea id="container_<?php echo $name; ?>" name="<?php echo $name; ?>" style="height: 400px"></textarea>
<script type="text/javascript" src="/component/element/ueditor/public/static/ueditor.config.js"></script>
<script src="/component/element/ueditor/public/static/ueditor.all.min.js"></script>

<script type="text/javascript">
    var ue_<?php echo $name; ?> = UE.getEditor('container_<?php echo $name; ?>', {
        toolbars: [

            <?php
            if (!isset($polymorphic) || $polymorphic == 1) {
            ?>[
                    'fullscreen', 'source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                    'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                    'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
                    'directionalityltr', 'directionalityrtl', 'indent', '|',
                    'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
                    'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
                    'simpleupload', 'insertimage', 'template', 'background', 'horizontal', '|',
                    'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
                    'print', 'preview', 'searchreplace', 'drafts'
                ]
            <?php
            } else {
            ?>[
                    'fullscreen', 'source', '|', 'undo', 'redo', '|',
                    'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                    'rowspacingtop', 'rowspacingbottom', 'lineheight', '|'
                ]
            <?php
            } ?>

        ],
        initialFrameWidth: '100%', //宽度随浏览器自适应
        wordCount: false, //关闭字数统计
        elementPathEnabled: false, //隐藏元素路径
        autoHeightEnabled: true, //是否自动长高
        autoFloatEnabled: true, //是否保持toolbar的位置不动
        <?php
        if (!isset($polymorphic) || $polymorphic == 1) {
        ?>
            serverUrl: '/element/ueditor/Index/upload?&token=<?php echo element_safe_token('ueconfig'); ?>'
        <?php
        } ?>

    });
    ue_<?php echo $name; ?>.ready(function() {
        //ue.setHeight(400);
        ue_<?php echo $name; ?>.setContent(`<?php echo  isset($value) ? $value : '' ?>`);
    });
</script>